Running a script after Windows scheduler shutdown and restarts the server

I have a script that is to be run after the Windows scheduler stops the server.
If the server is not restarted before the script is run I was thinking of having some kind of while loop to send a system command to check if the server is up before continuing on with the rest of the script. Any ideas or advice?

Thanks in advance..
lsand - Fri Feb 18 15:19:37 EST 2011

Re: Running a script after Windows scheduler shutdown and restarts the server
llandale - Fri Feb 18 16:07:42 EST 2011

You have a DOORS script that is supposed to run after the Server turns off the DOORS service? You have a Windows Scheduled task that shuts down the DOORS service (perhaps 1am?)?

I think you should provide a little more info. Such as "I want to schedule a shut down of the DOORS service, run VBA maintenance on the DOORS database, re-start the DOORS service and when its running, run a DOORS client batch-job to do more stuff".

  • Louie

Re: Running a script after Windows scheduler shutdown and restarts the server
lsand - Fri Feb 18 16:42:46 EST 2011

llandale - Fri Feb 18 16:07:42 EST 2011
You have a DOORS script that is supposed to run after the Server turns off the DOORS service? You have a Windows Scheduled task that shuts down the DOORS service (perhaps 1am?)?

I think you should provide a little more info. Such as "I want to schedule a shut down of the DOORS service, run VBA maintenance on the DOORS database, re-start the DOORS service and when its running, run a DOORS client batch-job to do more stuff".

  • Louie

Sorry for the confusion. I want to run a script after the server is stopped and restarted.
After the server is restarted I want to run a DOORS client batch-job to do more stuff.

In the script, I want to make sure the DOORS server is restarted before continuing execution of the script. What sort of command is available to do this check?

Re: Running a script after Windows scheduler shutdown and restarts the server
Mathias Mamsch - Fri Feb 18 17:40:06 EST 2011

lsand - Fri Feb 18 16:42:46 EST 2011
Sorry for the confusion. I want to run a script after the server is stopped and restarted.
After the server is restarted I want to run a DOORS client batch-job to do more stuff.

In the script, I want to make sure the DOORS server is restarted before continuing execution of the script. What sort of command is available to do this check?

Why not check if the service is running?
 

tasklist /FI "SERVICES eq DOORS DB Server 8.2" | find /I /N "doorsd.exe"
if "%ERRORLEVEL%"=="0" echo DOORS 8.2 Server is running

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Running a script after Windows scheduler shutdown and restarts the server
lsand - Mon Feb 21 10:32:02 EST 2011

Mathias Mamsch - Fri Feb 18 17:40:06 EST 2011

Why not check if the service is running?
 

tasklist /FI "SERVICES eq DOORS DB Server 8.2" | find /I /N "doorsd.exe"
if "%ERRORLEVEL%"=="0" echo DOORS 8.2 Server is running

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Is that check done from the DOORS client?

Re: Running a script after Windows scheduler shutdown and restarts the server
llandale - Mon Feb 21 12:06:37 EST 2011

lsand - Mon Feb 21 10:32:02 EST 2011
Is that check done from the DOORS client?

If you can run the DOORS client and invoke a DOOR DXL script, then the DOORS service has indeed started OK. That's like asking "How can I tell if my car is running while I'm cruising down the freeway at 70mph in my car?".

I think you need a non-DXL "script", perhaps VBA, to do this work. I don't know how to "ask" if the DOORS service is running, but if I did it would be some sort of "pingTo 36677@DoorsSever" system command. Failing that, you could attempt to start the doors.exe client in batch mode; where the batch code simply create a certain file and exists DOORS, you would then see of that file got created to determine if doors.exe started. And if it did you could start the doors.exe to do your actual work, and if not go to sleep for 15 minutes and try again.

  • Louie

OK, maybe you want a DXL script connected to some OTHER database running, and try to see if the 1st DOORS service is running.